package meijuli.com.join51.business.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;

import meijuli.com.join51.business.fragment.WithdrawWayFragment;
import meijuli.com.join51.business.model.WithdrawRule;

/**
 * 兑换方式
 *
 * @author Wizong 2017-05-19 13:09
 */
public class WithdrawWayActivity extends BaseFragmentActivity {
    public static final String KEY_WITHDRAW_RULE = "key_withdraw_rule";
    public static final String KEY_WITHDRAW_TYPE = "key_withdraw_type";

    public static void start(Activity activity, WithdrawRule withdrawRule, String withdrawType) {
        Intent intent = new Intent(activity, WithdrawWayActivity.class);
        intent.putExtra(KEY_WITHDRAW_RULE, withdrawRule);
        intent.putExtra(KEY_WITHDRAW_TYPE, withdrawType);
        activity.startActivity(intent);
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setToolBarTitle("兑换方式");

        WithdrawRule withdrawRule = (WithdrawRule) getIntent().getSerializableExtra(KEY_WITHDRAW_RULE);
        String withdrawType = getIntent().getStringExtra(KEY_WITHDRAW_TYPE);
        addFragment(WithdrawWayFragment.newInstance(withdrawRule, withdrawType));
    }
}
